int nexts(char *s, char *t) {

  int e = 0;
  int st = 0; 
  int ch2;
  char ch;
  static char *p;

	if(ch == NEWL) {
		p = s;
	}
	
	a:
	while(1){
		ch = *p;
		ch2 = (((int)ch)<<8) + ((int)*(p + 1));

		switch(ch2) {
			case 0x2f2f: 
					ch = '\n';
					break;
			case 0x3c3d: 
				  ch=(char)128;
                  p++;
                  break;
			case 0x3d3d: 
				  ch=(char)129;
                  p++;
                  break;
			case 0x213d: 
				  ch=(char)130;
                  p++;
                  break;
			default: ""; 
		}

		switch((int)kind[(int)ch & 0x00ff]) {
				case 0:
					*t = EOS;
					return (-st);
				case 1:
					if(st == 0){
					st = 3;
					}
					if(((ch == 'e') || (ch == 'E')) && ((st == 5) || (st == 6)) && (e == 0)){
						st = 6;
						e++;
					}
					else{
						if(st > 4) {
							st = 4;
						}
					}
				case 2:
					if(st == 0){
						st = 5;
					}
					p++;
					*t++ = ch;
					break;
				case 3:
					if(st == 0){
						*t++ = ch;
						p++;
              
						if((ch == '-') && isdigit(*p) &&((lsymb == 303) || (lsymb == 352) || (lsymb == 354) || ((358 < lsymb) && (lsymb < 364)))){
							st = 5;
							break;
						}
						else{
							*t = EOS;
							return(2);
						}
					}
					else{
						if(st == 3) {
							*t = EOS;
							return(3);
						}
						else {
							if((ch == '-') && ((*(t - 1) == 'e') || (*(t - 1) == 'E'))) {
								p++;
								*t++ = ch;
								break;
							}
							else{
								if(ch == '.') {
									*t++ = ch;
									p++;
                  
									if(st > 4) {
										st++;
									}
								break;
								}
								else{
									*t = EOS;
									return(st);
								}
							}
						}
					}

				case 4:
					p++;
					if(st) {
						*t = EOS;
						return(st);
					}
					else{
						break;
					}
				case 5: 
					if(st == 0) {
						p++;
						return(1);
					}
					else{
						*t = EOS;
						return(st);
					}
				}
    
		}
	}
